package com.idea.plugin.core.helper;

import com.thoughtworks.qdox.JavaProjectBuilder;
import com.thoughtworks.qdox.model.JavaClass;

/**
 * @author yanzhao
 * @date 2022/2/24 17:52
 * @since 1.0.0
 */
public class JavaClassHelper {

    public static JavaProjectBuilder javaProjectBuilder = new JavaProjectBuilder();

    public static JavaClass findClassByQualifiedName(String qualifiedName) {
        JavaClass javaClass = JavaClassHelper.javaProjectBuilder.getClassByName(qualifiedName);
        return javaClass;
    }

    public static JavaClass findSuperClassByQualifiedName(String qualifiedName) {
        JavaClass javaClass = JavaClassHelper.javaProjectBuilder.getClassByName(qualifiedName);
        return javaClass.getSuperJavaClass();
    }

}
